package com.db.patterns.server;

import java.util.concurrent.BlockingQueue;

import cm.db.patterns.commands.Command;
/**
 * 
 * @author Rayman
 * Very simple implementation of like a remote client cache, but used blocking queue for interactions with client
 */
public class RemoteClientCache implements ClientCache {

	BlockingQueue<Command> queue;
	public RemoteClientCache(BlockingQueue<Command> queue) {
		this.queue = queue;
	}
	@Override
	public void update(Command command) {
		try {
			queue.put(command);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}
